package com.lichuang.fruitvarietysm.order.config;

import java.io.FileWriter;
import java.io.IOException;


/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016092000558278";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVqa98vhbcZDegvLSyUEScvbzLdTt3JtTITFg/KzouCFCjte+52IkYVcYn0zh1kNW1feCEW6WsQj7XIQcYjcX+qFiLmT8rhhSNEWYZEGjqorGCUk29myBu9hBOqeA+FYac4/psNeg3WC9y3KrlYMLLoX6ScWhs4xQMto71/cKTQ6r8DLn1O2jNWjy5cb1oE1qg7fbTIyIJuMy26mT6vxI5rWZ17LlB6q06Hr1AK+dxDNJDiYOuzbdCQHErImtcPkdw2JO9TSc2oIWJXKd0l+33cyUmkMhEuQaVMUAGeu31uRv4Qqf27KGzj+xKLtW/KkzYEOqQvZ3QZ7WUj5xvxmIBAgMBAAECggEBAIZZR9Y0EfOP5zvcil0TnzQRQzxlJZeFfTe9CO7T0CtofXMorGVpk1AMF5DClIk9FgsRT42hc6yZ3y1hUaxiAF3lI29VhxZ8C1DDUKKpT3VpzO1PEshlTA0vyF3FMy6oRinqoW+oSKf9+sIigyrb3KHNfADb20D765CqBNWgEZ39m8I7rNosJdL0M3B0nM516dxZ7B5/JYpzXpfSvL25x+bU04sJ+aGqyjU9CXN92CzDbMIpz3OZvS458w9M+oXz6SSd33PGxKO6yFsRM6q2+PDhgfm9JqQk5LFDhfHGXJ8BNLhu4lS+f8KDWr268sqwILv+ogplEH8ArIXDx0xfcdECgYEA3HqEJLl38qjUC7tu+UJSnV9auojoX3A+/gpbI09t+ow4/59o9ZsEIIv80h9l51xVMUjaFqk7gBwwhk3w+f2CcAAnnQ6m20Mv0uDnn8hJ+NPj2gwp8KVx3jZjNAuOXLLtzGRgvBGEq6ZoTGKxFMvwnmfnvU0+lzA98Eb0p/TPvEUCgYEArcZsex3h027TNdUg9JVHAHVw5E+BtdjgdTCnsRlbti5DWKGNDTttPG9e2UoE/2df8eRP3qh0JdsukVqKb2Ccl+k/f9Lvc49cBPma2F+JsP7x2HewAGKgCoOtl8GNo42EmvoNRqWs8CaY4gu/s7S0Pg+8S3QxWl+QsFlZOeKf8I0CgYAnd/c368vBMN/kycTv8iN/8JX5VpDipOFh8NCn3Yw+keOSPyM29G0ktmqn4t8HL8xAal5AOENih6lYIZPF7M/w5NYyk3DjR3/ELGbKf7xeQvBDFHJdlgBwWyQfKQJvLcjMEhwPDsPFRqDdK72vj2KfuNIPXUibIBO2c71QY87cUQKBgGfkr8rTzMXqBmCy8acI8JA3pqz5U+Vyqo+l7TwWmxxKgH0m6Pu2QdLWCvECLga8uUIXbCEEuZxAdJD2frmkGzs/enVjmUGPvkZDLO6b/+hQJCt1M0ansGNY4ppOX+4el99IDFPmjYRurwzGVXCNYw2PvtWlvDP52rl0UcIn2dOpAoGALxXIOG6ov3hBAZygIetJtgjbUwmQdugOBfBQNKYslLoLcWoIbvLMCtxwbv30474krC9vwr6eONX0TCR1lXp+oU5vtF9BJSbotQKZORLG6njXUgAiKC7711tGvozddfdYITWt+kG+/NJyaBlNMD/GZJPu428EH/eeqWgWaDXVq7U=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA515v3kHgFyu13VX4fFGpCrAtvMFF9wJy57MaeXICoVF5fa6XHt9BtoN9e/5jELwCGiiAekhPl6c5W0s7UK16iqlmgDseuBGAMdEFhWJbB24elKG6Z/imWFLJFIdGUvieKMPetFyqJISqghPqSqH3BHsbf++OBfDck03/b2juwAl5Sl6dlHnlNYb8XAjLNpaaS7UiKZfwB5pOVDEV1+Bs/p/9fM/o073yRguOyoPDWG5jtMO0n6m6LQEkaai2n1dUav8FVPqdFqX2ZMm7gChNcdsspT2LNjkfHIpYJQhFAsDNASvBT5sLGNz0+X4C0v0S2LcN9O7lST/y0mbib+q6gQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://www.hanghang.store/order/alipayNotifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8082/order/alipayReturnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "G:\\ACCP\\BOOKS\\使用JSP／Servlet技术开发新闻发布系统\\支付宝电脑网站支付\\log";

	// 商户UID
    public static String seller_id = "2088102176536784";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

